<?php
 include("../../MerchandiseBay/conn.php"); 


$name=$_REQUEST['name'];
$username=$_REQUEST['username'];
$password=$_REQUEST['password'];
$job=$_REQUEST['job'];

$SQL="select * from admin where username='$username'";
$qry=mysql_query($SQL,$conn);


?>
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>New Page 1</title>
<style type="text/css">
<!--
body {
	background-color: #0099FF;
}
-->
</style></head>
<body>
<?
if(mysql_num_rows($qry)>0) 
{ 
$row=mysql_fetch_assoc($qry);
?>
<div align="center">
<table border="1" width="462" style="border-collapse: collapse" bordercolor="#333333"><tr><td>
	<table border="0" width="102%" id="table1">
		<tr>
			<td background="../../mc/images/background/m3.jpg"><font face="Verdana" size="4" color="#FF0000">&nbsp;ERROR 
              ! </font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp; Information Staff already 
              in the record</font></td>
		</tr>
		<tr>
			<td><font face="Verdana" size="2">&nbsp; Username : <?echo $row['username']?></font></td>
		</tr>
		<tr>
			<td> &nbsp;&nbsp;<font size="2" face="Verdana"> Name : <?echo $row['name']?></font></td>
		</tr>
		<tr>
			<td align="center">
			<input type="button" value="Back" name="B4" onClick="history.back();"></td>
		</tr>
	</table></td></tr></table>
</div>
<? }
else {

$addstaffSQL="insert into admin (name,password,username,job) values('$name','$password','$username','$job')";
$addstaffQuery=mysql_query($addstaffSQL,$conn);
?>
<div align="center">
<table border="1" width="462" style="border-collapse: collapse" bordercolor="#333333"><tr><td>
	<table border="0" width="100%" id="table1">
		<tr>
			<td background="../../mc/images/background/blueBG.gif"> <font color="#0033FF" size="4" face="Verdana">Add 
              Staff Successfull</font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Name : <?=$name?></font></td>
		</tr>
		<tr>
			<td><font size="2" face="Verdana">&nbsp;Username : <?=$username?></font></td>
		</tr>

		<tr>
			<td><font size="2" face="Verdana">&nbsp;Job : <?=$job?></font></td>
		</tr>

		<tr>
			<td>
			<p align="center"><font size="2" face="Verdana"> <a href="adminHome.php">Home 
               </a> <font color="#0000FF">| </font><a href="addStaffpapar.php">Add 
                Staff</a></font></td>
		</tr>
	</table></td></tr></table>
</div>
<?}?>
</body>

</html>